<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>计数器</title>
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <script src="../js/bootstrap.min.js"></script>
    <script src="../js/jquery-3.1.1.min.js"></script>
    <script>
        function calculate(){
            var a;
            alert(typeof(a));
            // var number1 =parseInt(document.getElementById("number1").value) ;
            // var number2 = parseInt(document.getElementById("number2").value);
            // var operator = document.getElementById("select").value;
            // switch (operator){
            //     case "+":
            //         alert("结果是:"+(number1+number2));
            //         break;
            //     case "-":
            //         alert("结果是:"+(number1-number2));
            //         break;
            //     case "*":
            //         alert("结果是:"+(number1*number2));
            //         break;
            //     case "/":alert("结果是:"+(number1/number2));
            // }
        }
    </script>
</head>
<body>
    <input type="text" id="number1" placeholder="第一个数">
    <select id="select">
        <option value="-1">--请选择--</option>
        <option value="+">+</option>
        <option value="-">-</option>
        <option value="*">*</option>
        <option value="/">/</option>
    </select>
    <input type="text" id="number2" placeholder="第二个数">
    <input type="button" value="确定" onclick="calculate()">
</body>
</html>